<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function require(file) {
            var exports = {};
            (function (exports, code) {
                eval(code)
            })(exports, "var a = 123;exports.default = function (a, b){return a + b}");

            return exports
        }

        var add = require('add.js').default;
        console.log(add(1, 5));
    </script>
</body>

</html>